<script lang="ts" setup>
import {useRoute, useRouter} from "vue-router";

import { ref } from 'vue'
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
const route = useRoute();
const router = useRouter();
const isCollapse = ref(true)
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

</script>

<template>
  <div class="wrapper"></div>
  <div class="left-menu">
    <el-radio-group v-model="isCollapse" style="margin-bottom: 0.5vh;margin-top: 2vh;height: 5vh;">
      <el-radio-button :label="false">扩展</el-radio-button>
      <el-radio-button :label="true">回收</el-radio-button>
    </el-radio-group>
    <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        :collapse="isCollapse"
        @open="handleOpen"
        @close="handleClose"
        style="height: 80vh ;align-content: space-between;background-color: aliceblue;border: 0;"
    >
      <el-menu-item index="1" style="margin-bottom: 1.5vw" @click="item => {
        router.push({
        path:'/business/shopList'
        })
      }">
        <el-icon><setting /></el-icon>
        <template #title>门店管理</template>
      </el-menu-item>

      <el-menu-item index="2" style="margin-bottom: 1.5vw" @click="item => {
        router.push({
        path:'/business/shopItemList'
        })
      }">
        <el-icon><icon-menu /></el-icon>
        <template #title>商品管理</template>
      </el-menu-item>

      <el-menu-item index="3" style="margin-bottom: 1.5vw" @click="item => {
        router.push({
        path:'/business/customerOrderList'
        })
        }">
        <el-icon><document /></el-icon>
        <template #title>订单管理</template>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 8vw;
}
.left-menu {
  background-color: aliceblue;
  border-radius: 2vw;
  height: 100%;
  width: 8vw;
  top: 0;
  left: 0;
  position: fixed;
}
</style>
